<?php

/***  DOCUMENTATION LAYER

Baffle Class Debugging Test

Last Update: Aug 2007
	
DESCRIPTION
	test smtp mailer
	
NOTES
		
***/

$_tx0 = microtime();

// Test Name
$test_name = 'debug ceo kernel';

// Include Files
require_once('../www/ceo.project_driver.inc.php');

// Variable Declarations
#$foo = 'bar';

// Simple Test of Class
if ( 1 )
{
  $Test = new CeoFramework($debug=1, 'CeoFramework');
  $Test->print_d('testing CeoFramework mailer');
  $Test->PATH['datasafe'] = $Test->super_root . '__DEV'.$Test->DS.'nudgewink.inc.php';
  $Test->load_framework();
  
  // Testing with Gmail (NOTE: after framework loaded!)
  $Test->use_smtp = 1;
  $Test->smtp_host = 'smtp.att.yahoo.com';
  $Test->Mailer->Port = 25;
  $Test->smtp_user = $CEO_SAFE['smtp_user'];
  $Test->smtp_password = $CEO_SAFE['smtp_password'];

  // Email settings
  $to_email = 'klenwell@gmail.com';
  $to_name = 'Tom at klenwell@gmail.com';
  $subject = 'testing CeoFramework Mailer';
  $body= "this is a test of CeoFramework Mailer\n\nthis is only a test\n\nmore info at http://code.google.com/p/klenwell/";

  if ( $Test->email($to_email, $to_name, $subject, $body) )
  {
    $Test->print_d("mail was sent successfully (check $to_email)", 'green');
  }
  else
  {
    $Test->print_d('mail failed.  there should have been an error message.', 'red');
  }
}


// Footer
$_txn = microtime();
$stx = number_format(((substr($_txn,0,9)) + (substr($_txn,-10)) - (substr($_tx0,0,9)) - (substr($_tx0,-10))),4); 
echo "<h6>test '$test_name' complete in $stx s</h6>";

?>
